﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using BonjourHotel.Core.Localization;

namespace BonjourHotel.Core.Context
{
    public class BonjourHotelContext
    {
        public static BonjourHotelContext Current
        {
            get
            {
                if(HttpContext.Current == null)
                    return null;

                if (HttpContext.Current.Items["BonjourHotelContext"] == null)
                {
                    BonjourHotelContext context = new BonjourHotelContext();
                    HttpContext.Current.Items.Add("BonjourHotelContext", context);
                    return context;
                }
                else
                {
                    return (BonjourHotelContext)HttpContext.Current.Items["BonjourHotelContext"];
                }
            }
        }

        public static string WorkingLanguage
        {
            get
            {
                return LocaleManager.DefaultLanguage;
            }
        }
    }
}
